package Observer;

import java.util.List;

public class WordCharNumObserver implements Observer {
    private int wordNum;
    private int charNum;
    @Override
    public void update(Text t) {
        List<String> text = t.getText();
        wordNum = text.size();
        charNum = text.stream()
            .mapToInt(String::length).sum();
    }
}
